import request from '@/utils/request'

// 按案卷题名查询案卷管理列表
export function listArchivesByName(query) {
  return request({
    url: '/system/archives/listByName',
    method: 'get',
    params: query
  })
}

// 查询案卷管理列表
export function listArchives(query) {
  return request({
    url: '/system/archives/list',
    method: 'get',
    params: query
  })
}

// 查询柱状图、饼状图信息
export function listArchivesBar(query) {
  return request({
    url: '/system/archives/bar',
    method: 'get',
    params: query
  })
}

// 查询案卷台账
export function listArchivesBook(query) {
  return request({
    url: '/system/archives/listBook',
    method: 'get',
    params: query
  })
}

// 查询案卷管理详细
export function getArchives(archivesId) {
  return request({
    url: '/system/archives/' + archivesId,
    method: 'get'
  })
}
// 查询案卷管理详细
export function getanjuanbaoExport(archivesId) {
  return request({
    url: '/system/anJuanBaoExport/' + archivesId,
    method: 'get'
  })
}

// 新增案卷管理
export function addArchives(data) {
  return request({
    url: '/system/archives',
    method: 'post',
    data: data
  })
}

// 修改案卷管理
export function updateArchives(data) {
  return request({
    url: '/system/archives',
    method: 'put',
    data: data
  })
}

// 删除案卷管理
export function delArchives(archivesIds) {
  return request({
    url: '/system/archives/' + archivesIds,
    method: 'delete'
  })
}

// 申请归档
export function updateArchivesApply(archivesIds) {
  return request({
    url: '/system/archives/apply/' + archivesIds,
    method: 'put'
  })
}
  // 归档通过
export function updateArchivesApprove(archivesIds) {
  return request({
    url: '/system/archives/approve/' + archivesIds,
    method: 'put'
  })
}
// 归档拒绝
export function updateArchivesReject(archivesIds) {
  return request({
    url: '/system/archives/reject/' + archivesIds,
    method: 'put'
  })
}
